﻿import QtQuick 2.0

Rectangle {
    PhotoUnit {
        id: photo1
        anchors.top: parent.top
        anchors.horizontalCenter: parent.horizontalCenter
    }
    PhotoUnit {
        id: photo2
        anchors.top: parent.top
        anchors.horizontalCenter: parent.horizontalCenter
    }
    PhotoUnit {
        id: photo3
        anchors.top: parent.top
        anchors.horizontalCenter: parent.horizontalCenter
    }
    PhotoUnit {
        id: photo4
        anchors.top: parent.top
        anchors.horizontalCenter: parent.horizontalCenter
    }
    PhotoUnit {
        id: photo5
        anchors.top: parent.top
        anchors.horizontalCenter: parent.horizontalCenter
    }
    PhotoUnit {
        id: photo6
        anchors.top: parent.top
        anchors.horizontalCenter: parent.horizontalCenter
    }
    PhotoUnit {
        id: photo7
        anchors.top: parent.top
        anchors.horizontalCenter: parent.horizontalCenter
    }
    PhotoUnit {
        id: photo8
        anchors.top: parent.top
        anchors.horizontalCenter: parent.horizontalCenter
    }
    PhotoCenterUnit {
        id: photoCenter
        opacity: 0
        anchors.centerIn: parent
    }
    ParallelAnimation {
        id: parallelAnimation
        loops: 1

        PropertyAnimation {
            properties: "opacity"
            target: photoCenter
            easing.type: Easing.InOutSine
            from: 0
            to: 1
            duration: 1000
        }
        SequentialAnimation {
            PropertyAnimation {
                properties: "rotation"
                target: photo1
                easing.type: Easing.InOutSine
                from: 0
                to: 60
                duration: 1000
            }
            PauseAnimation {
                duration: 50
            }
            PropertyAnimation {
                properties: "rotation"
                target: photo1
                easing.type: Easing.InOutBounce
                from: 60
                to: 45
                duration: 100
            }
        }
        SequentialAnimation {
            PropertyAnimation {
                properties: "rotation"
                target: photo2
                easing.type: Easing.InOutSine
                from: 0
                to: 105
                duration: 1000
            }
            PauseAnimation {
                duration: 50
            }
            PropertyAnimation {
                properties: "rotation"
                target: photo2
                easing.type: Easing.InOutBounce
                from: 105
                to: 90
                duration: 100
            }
        }
        SequentialAnimation {
            PropertyAnimation {
                properties: "rotation"
                target: photo3
                easing.type: Easing.InOutSine
                from: 0
                to: 150
                duration: 1000
            }
            PauseAnimation {
                duration: 50
            }
            PropertyAnimation {
                properties: "rotation"
                target: photo3
                easing.type: Easing.InOutBounce
                from: 150
                to: 135
                duration: 100
            }
        }
        SequentialAnimation {
            PropertyAnimation {
                properties: "rotation"
                target: photo4
                easing.type: Easing.InOutSine
                from: 0
                to: 195
                duration: 1000
            }
            PauseAnimation {
                duration: 50
            }
            PropertyAnimation {
                properties: "rotation"
                target: photo4
                easing.type: Easing.InOutBounce
                from: 195
                to: 180
                duration: 100
            }
        }
        SequentialAnimation {
            PropertyAnimation {
                properties: "rotation"
                target: photo5
                easing.type: Easing.InOutSine
                from: 0
                to: 240
                duration: 1000
            }
            PauseAnimation {
                duration: 50
            }
            PropertyAnimation {
                properties: "rotation"
                target: photo5
                easing.type: Easing.InOutBounce
                from: 240
                to: 225
                duration: 100
            }
        }
        SequentialAnimation {
            PropertyAnimation {
                properties: "rotation"
                target: photo6
                easing.type: Easing.InOutSine
                from: 0
                to: 285
                duration: 1000
            }
            PauseAnimation {
                duration: 50
            }
            PropertyAnimation {
                properties: "rotation"
                target: photo6
                easing.type: Easing.InOutBounce
                from: 285
                to: 270
                duration: 100
            }
        }
        SequentialAnimation {
            PropertyAnimation {
                properties: "rotation"
                target: photo7
                easing.type: Easing.InOutSine
                from: 0
                to: 330
                duration: 1000
            }
            PauseAnimation {
                duration: 50
            }
            PropertyAnimation {
                properties: "rotation"
                target: photo7
                easing.type: Easing.InOutBounce
                from: 330
                to: 315
                duration: 100
            }
        }
        SequentialAnimation {
            PropertyAnimation {
                properties: "rotation"
                target: photo8
                easing.type: Easing.InOutSine
                from: 0
                to: 375
                duration: 1000
            }
            PauseAnimation {
                duration: 50
            }
            PropertyAnimation {
                properties: "rotation"
                target: photo8
                easing.type: Easing.InOutBounce
                from: 375
                to: 360
                duration: 100
            }
        }
    }
}
